<?
class ModuleAdmin extends Module{
	function ModuleAdmin($row){
		Module::Module($row);
		
		if(User::is_root())
		{
			$cmd = Url::get('cmd', '');
			
			switch($cmd)
			{
				case 'delete_cache':
					ECore::update_all_page();
					require_once ROOT_PATH.'includes/dir.php';
					empty_all_dir(PAGE_CACHE_DIR,true);
					Url::redirect_current();
					break;
				case 'scan':
					require_once 'forms/scan.php';
					$this->add_form(new ScanModuleForm());
					break;
				default:
					require_once 'forms/list.php';
					$this->add_form(new ListModuleAdminForm());
			}
		}
		else{
			Url::access_denied();
		}
	}
}
?>